package edu.sctu.zhoumengxue.day201506.day20150605;


import java.text.SimpleDateFormat;
import  java.util.Calendar;
import  java.util.Date;
/**
 * Created by user12 on 2015/6/5.
 */
public class DateUtil {

    public void getDateTime(){

        Date date = new Date();
        System.out.println(date.getTime());
    }

    public void nowDate(){

        SimpleDateFormat simpleDateFormat = new SimpleDateFormat();
        System.out.println(simpleDateFormat.format(new Date()));

    }

    public void getCalendar(){

        Calendar calendar = Calendar.getInstance();
        calendar.add(Calendar.MONTH, -1);
        System.out.println(calendar.get(Calendar.YEAR));
        System.out.println(calendar.get(Calendar.MONTH));

    }
}
